<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: qiwenyong
  Date: 2024/10/23
  Time: 11:37
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>

<head>
    <link href="${pageContext.request.contextPath}/css/bootstrap.css" rel="stylesheet" media="screen">
    <link href="${pageContext.request.contextPath}/css/bootstrap-datetimepicker.min.css" rel="stylesheet" media="screen">
    <script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery.min.js" charset="UTF-8"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/js/bootstrap.min.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/js/bootstrap-datetimepicker.js" charset="UTF-8"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/js/bootstrap-datetimepicker.zh-CN.js" charset="UTF-8"></script>
</head>

<body>
<div style="padding:5px; margin:0px;">
    <ul class="breadcrumb" style="  margin:0px; ">
        <li>
            <a href="product_list.html">商品管理</a>
        </li>
        <li>增加商品</li>
    </ul>
</div>

<form action="${pageContext.request.contextPath}/ProductAddServlet" method="post" class="form-horizontal">

    <!--开始 -->
    <div class="row">
        <div class="col-sm-6">

            <div class="form-group">
                <label class="col-sm-3 control-label">商品名称</label>
                <div class="col-sm-9">
                    <input type="text" name="name" class="form-control input-sm" />
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">商品类型</label>
                <div class="col-sm-4">
                    <%--<select class="form-control" name="category">
                        <option value="">--请选则---</option>
                        <option value="图书">图书</option>
                        <option value="水果">水果</option>
                        <option value="衣服">衣服</option>
                        <option value="手机">手机</option>
                    </select>--%>
                        <select class="form-control" name="category">
                            <option value="">--请选则---</option>
                            <c:forEach items="${categoryList}" var="c">
                                <option value="${c.id}">${c.name}</option>
                            </c:forEach>
                        </select>
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-3 control-label">商品价格</label>
                <div class="col-sm-9">
                    <input type="number" name="price" class="form-control input-sm" />
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">商品库存</label>
                <div class="col-sm-9">
                    <input type="number" name="stock" class="form-control input-sm" />
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">商品状态</label>
                    <input type="radio" value="1" name="state">可售
                    <input type="radio" value="0" name="state">禁售
                <div class="col-sm-9">
                </div>
            </div>


        </div>
    </div>
    <!--结束 -->
    <div class="row">
        <div class="col-sm-3 col-sm-offset-2">
            <input type="submit" class="btn btn-success" value="提交" />
            <a class="btn btn-warning" href="product_list.html">返回上一级</a>
        </div>
    </div>
</form>

<script type="text/javascript">
    $('.form_date').datetimepicker({
        language: 'zh-CN',
        weekStart: 1,
        todayBtn: 1,
        autoclose: 1,
        todayHighlight: 1,
        startView: 2,
        minView: 2,
        forceParse: 0,
        format: 'yyyy-mm-dd'
    });
</script>
</body>

</html>
